<html>
<head><meta charset="utf-8"><title>stress-test · t-compiler/wg-self-profile · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/index.html">t-compiler/wg-self-profile</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html">stress-test</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204657509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204657509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204657509">(Jul 22 2020 at 12:15)</a>:</h4>
<p>Hey all. The Windows Runtime crate (<a href="https://crates.io/crates/winrt">https://crates.io/crates/winrt</a>) which I help maintain, sometimes generates massive amounts of code. This is because some of the APIs we are creating bindings for are incredibly big. We've created a stress test which takes roughly 1 hour to compile. Perhaps this could be a good benchmark to focus speed improvements for rustc on? <a href="https://github.com/kennykerr/stress-rs">https://github.com/kennykerr/stress-rs</a> Please let me know what you think!</p>



<a name="204657690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204657690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204657690">(Jul 22 2020 at 12:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> your name came up as someone who might find this interesting. Pinging for visibility :-)</p>



<a name="204657831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204657831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204657831">(Jul 22 2020 at 12:19)</a>:</h4>
<blockquote>
<p>The bindings crate produces around 160MB of Rust source code - about 3.3 million lines of code.</p>
</blockquote>
<p>wow</p>



<a name="204657854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204657854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204657854">(Jul 22 2020 at 12:19)</a>:</h4>
<p>But how long does compiling a 160 MB <code>.cpp</code> file take?</p>



<a name="204657953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204657953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204657953">(Jul 22 2020 at 12:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224872">Ryan Levick</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204657690">said</a>:</p>
<blockquote>
<p>your name came up as someone who might find this interesting. Pinging for visibility :-)</p>
</blockquote>
<p>interesting indeed :) I'll try and see if I can also gather stats to help the WG ( <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> we talked for a bit at RustFest Barcelona :)</p>



<a name="204659169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204659169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204659169">(Jul 22 2020 at 12:34)</a>:</h4>
<p>it'd be to nice how "much slower than your average C++ compiler" that is indeed</p>



<a name="204659568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204659568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204659568">(Jul 22 2020 at 12:38)</a>:</h4>
<p>it will be interesting to observe how slow the compiler is before reaching 3.3M lines, and it seems it's possible to cut the number of generated bindings in this example</p>



<a name="204661644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204661644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204661644">(Jul 22 2020 at 13:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> I'm definitely interested in also reducing the amount of code we generate, and generating more compiler friendly code if possible, but I also thought that it could be helpful to speed up rustc as well.<br>
I need to ask my colleague how long a similar compilation takes in C++</p>



<a name="204661668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204661668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204661668">(Jul 22 2020 at 13:00)</a>:</h4>
<p>yeah this is likely pretty helpful, for sure!</p>



<a name="204661793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204661793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204661793">(Jul 22 2020 at 13:01)</a>:</h4>
<p>oh yes this seems like it's going to be enlightening for sure !</p>



<a name="204661854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204661854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204661854">(Jul 22 2020 at 13:02)</a>:</h4>
<p>I'm more than happy to help, but I'm not that familiar with the compiler profiling so I'll need your patience :-)</p>



<a name="204662123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204662123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204662123">(Jul 22 2020 at 13:04)</a>:</h4>
<p>tbh I'm only slightly more familiar, I'll <em>also</em> need your patience :) (but mark, wesley, and everyone else from the wg will have our backs I'm sure)</p>



<a name="204662207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204662207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204662207">(Jul 22 2020 at 13:05)</a>:</h4>
<p>it's an area of much interest so thanks for the example</p>



<a name="204672034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204672034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204672034">(Jul 22 2020 at 14:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204662123">said</a>:</p>
<blockquote>
<p>tbh I'm only slightly more familiar, I'll <em>also</em> need your patience :) (but mark, wesley, and everyone else from the wg will have our backs I'm sure)</p>
</blockquote>
<p>Yes, feel free to ping me/otherwise loop me in and I will be happy to help out!</p>



<a name="204672227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204672227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204672227">(Jul 22 2020 at 14:24)</a>:</h4>
<p>likewise!</p>



<a name="204675049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204675049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204675049">(Jul 22 2020 at 14:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> what's a good first step to take? Are you going to run a profiler over the code?</p>



<a name="204679771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204679771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204679771">(Jul 22 2020 at 15:16)</a>:</h4>
<p>(sorry I'm at work) I'd start with looking at the generated code first to have a sense of what's it doing (as I don't know winrt at all), just in case something jumps out (doubtful) in case it exercizes specific parts of the compiler. But mostly starting with small-ish parts extracted from the example, gathering statistics with the self-profiling features, and then over a series of bigger and bigger pieces of code from the example (otherwise, starting with, say, callgrind and its 100x perf cost on such a big benchmark will take a while). That is, trying to discover and reproduce patterns on smaller test cases, see the numbers on what queries and which parts of the compiler are slow (possibly instrumenting rustc in the process in case more information is needed)</p>



<a name="204680156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204680156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204680156">(Jul 22 2020 at 15:19)</a>:</h4>
<p>Yeah, I might also suggest trying just <code>perf top</code> while it's running (I presume you can compile on linux? There's probably similar tooling on windows though, anyway.) to get some idea of what it's doing</p>



<a name="204680174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204680174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204680174">(Jul 22 2020 at 15:19)</a>:</h4>
<p>my guess is that will give you some hot functions that you can then ask for feedback on here</p>



<a name="204680426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204680426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204680426">(Jul 22 2020 at 15:21)</a>:</h4>
<blockquote>
<p>about 3.3 million lines of code.</p>
</blockquote>
<p>First step is remove all those newlines — one line of code is faster than two <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="204680488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204680488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204680488">(Jul 22 2020 at 15:21)</a>:</h4>
<p>But seriously, at those sizes, leaving out whitespace might actually be noticeable.</p>



<a name="204680801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204680801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204680801">(Jul 22 2020 at 15:24)</a>:</h4>
<p>Would it make sense to split it into multiple crates? I know that the code is generated by a macro or build script, but I'm not sure if that's because it's a lot of code and nobody wants to wait for it to build.</p>



<a name="204705275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204705275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204705275">(Jul 22 2020 at 18:37)</a>:</h4>
<p>(it does not build on linux)</p>



<a name="204706294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204706294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204706294">(Jul 22 2020 at 18:45)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span> btw do you have more information on how was the 1 hour figure gathered, was it just <code>cargo check</code> in stress-rs ? or a debug or release build ? was it after a cargo clean or some time after <a href="http://winrt.rs">winrt.rs</a> was generated -- and generating the file is not counted in the 57 minutes ? (I specifically would like to know whether it is including the time it takes the build macro to generate (&lt; 2 mins) and rustfmt <a href="http://winrt.rs">winrt.rs</a> (around 20 mins here))</p>



<a name="204716159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716159">(Jul 22 2020 at 20:09)</a>:</h4>
<p>You can’t run it on Linux but we can easily change that. It’s meant for Windows but most of the code should not rely on platform specific stuff</p>



<a name="204716350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716350">(Jul 22 2020 at 20:10)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> are you saying rustfmt takes 20 minutes on your machine? To be honest I hadn’t checked how long that step took for the stress test</p>



<a name="204716380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716380">(Jul 22 2020 at 20:10)</a>:</h4>
<p>yes</p>



<a name="204716438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716438">(Jul 22 2020 at 20:11)</a>:</h4>
<p>it's still slow to build whether it's 40 minutes or 1h20 minutes don't get me wrong</p>



<a name="204716468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716468">(Jul 22 2020 at 20:11)</a>:</h4>
<p>but if it's included that's an easy win</p>



<a name="204716608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716608">(Jul 22 2020 at 20:12)</a>:</h4>
<p>Yes it’s included so the build time is 40 minutes</p>



<a name="204716634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716634">(Jul 22 2020 at 20:12)</a>:</h4>
<p>Which is a better starting point</p>



<a name="204716692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716692">(Jul 22 2020 at 20:12)</a>:</h4>
<p>(I'm looking around to gather statistics)</p>



<a name="204716858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204716858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204716858">(Jul 22 2020 at 20:14)</a>:</h4>
<p>(I also hope it's not my setup being weird and slow for rustfmt)</p>



<a name="204717176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204717176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204717176">(Jul 22 2020 at 20:16)</a>:</h4>
<p>knowing whether it was a check/debug/release build will still be helpful, especially if it's a check build where we can rule out a big chunk of the compiler</p>



<a name="204717676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204717676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204717676">(Jul 22 2020 at 20:20)</a>:</h4>
<p>It’s a debug build.</p>



<a name="204717711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204717711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204717711">(Jul 22 2020 at 20:20)</a>:</h4>
<p>great, thank you</p>



<a name="204717764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204717764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204717764">(Jul 22 2020 at 20:21)</a>:</h4>
<p>I’ll crate an issue with rustfmt to see if we can figure out why that’s taking so long</p>



<a name="204717985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204717985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204717985">(Jul 22 2020 at 20:23)</a>:</h4>
<p>yeah if you can also reproduce the slowness</p>



<a name="204724841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204724841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204724841">(Jul 22 2020 at 21:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204657854">said</a>:</p>
<blockquote>
<p>But how long does compiling a 160 MB <code>.cpp</code> file take?</p>
</blockquote>
<p>the readme was updated in the meantime and it mentions <a href="https://github.com/kennykerr/stress-rs/commit/17bbbeb5ad925021cc0d6b28700d8934babf93cb">around 90 seconds</a> (maybe with parallelism ?)</p>



<a name="204726368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204726368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204726368">(Jul 22 2020 at 21:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224872">Ryan Levick</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204716159">said</a>:</p>
<blockquote>
<p>You can’t run it on Linux but we can easily change that. It’s meant for Windows but most of the code should not rely on platform specific stuff</p>
</blockquote>
<p><code>cargo check</code> working on linux is enough for most compiler work, and would basically be necessary for most of our performance people to look at it I think -- at least I for one don't have windows</p>



<a name="204785306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204785306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204785306">(Jul 23 2020 at 11:36)</a>:</h4>
<p>Here's a version of the project that compiles on non-windows platforms: <a href="https://github.com/rylev/stress-rs">https://github.com/rylev/stress-rs</a> Follow the build instructions in the README.<br>
On my machine it takes ~23 minutes to run cargo check.</p>



<a name="204785495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204785495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204785495">(Jul 23 2020 at 11:40)</a>:</h4>
<p>Though roughly two minutes of that was code generation</p>



<a name="204789699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204789699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204789699">(Jul 23 2020 at 12:29)</a>:</h4>
<p>cargo build "only" takes 37 minutes on my machine. Not sure why the large difference to my colleague</p>



<a name="204793050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204793050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204793050">(Jul 23 2020 at 12:59)</a>:</h4>
<p>(on mine: this cargo checks in around 20 mins, rustfmt this time around 1 min; the generated <a href="http://winrt.rs">winrt.rs</a> is 6.6M lines which is double what we expected but that could be a difference due to formatting -- update: a meaningless difference)</p>



<a name="204795213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204795213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204795213">(Jul 23 2020 at 13:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224872">Ryan Levick</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204789699">said</a>:</p>
<blockquote>
<p>cargo build "only" takes 37 minutes on my machine. Not sure why the large difference to my colleague</p>
</blockquote>
<p>What version is used by you and your colleague?</p>



<a name="204809816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204809816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204809816">(Jul 23 2020 at 15:07)</a>:</h4>
<p>I don't think it's just a version difference, on 1.45 the xplatform repro builds in 22mins in my WSL1, and will behave as kenny/my repro on windows, with rustfmt consuming a core for dozens of minutes, finishing overall in 45mins</p>



<a name="204821789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204821789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204821789">(Jul 23 2020 at 16:39)</a>:</h4>
<p>(if Ryan wants more info about my numbers, in case they match Kenny's: here's some traces <a href="https://gist.github.com/lqd/0bd4cae82f43334701fa2062bac13070">https://gist.github.com/lqd/0bd4cae82f43334701fa2062bac13070</a> there are 1) forcing a panic after rustfmt (as your last println doesn't work for some reason; also a cool API to know is <code>Instant::elapsed()</code> no need to <code>t2 - t1</code> manually) on both the windows repro and xplatform repro on windows =&gt; 20 mins of formatting, 2) skipping formatting on the windows repro to build in 22 mins, 3) building with formatting turned on, on the xplatform repro on WSL to build in 22 mins)</p>



<a name="204854600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204854600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204854600">(Jul 23 2020 at 21:17)</a>:</h4>
<p>my suspicion is that it's related to the <code>specialization_graph_of</code> query of coherence checking, it's gradually taking more and more time as more bindings are added. (it may be all the <code>From</code> impls but that's conjecture)</p>



<a name="204854739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204854739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204854739">(Jul 23 2020 at 21:19)</a>:</h4>
<p>coherence checking is O(n²) in the number of impls for any given trait</p>



<a name="204854843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204854843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204854843">(Jul 23 2020 at 21:20)</a>:</h4>
<p>and the n is sufficiently large to be noticeable here</p>



<a name="204854863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204854863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204854863">(Jul 23 2020 at 21:20)</a>:</h4>
<p>I did some optimizations on this in the past, since it also shows up in profiles for some generated crates for embedded</p>



<a name="204854868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204854868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204854868">(Jul 23 2020 at 21:20)</a>:</h4>
<p>(<code>resolve_crate</code> is taking a while also)</p>



<a name="204855166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204855166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204855166">(Jul 23 2020 at 21:24)</a>:</h4>
<p>(the rest like <code>typeck_tables_of</code>, borrowck and evaluating obligations are not slow in aggregate either, but the count is very big so that's understandable)</p>



<a name="204855395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204855395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204855395">(Jul 23 2020 at 21:26)</a>:</h4>
<p>would you happen to know whether the specialization graph query is only used for specialization (or maybe I should ask Matthew, or actually look it up myself...) ?</p>



<a name="204855602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204855602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204855602">(Jul 23 2020 at 21:29)</a>:</h4>
<p>Building the specialization graph is what checks for overlap between impls</p>



<a name="204855668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204855668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204855668">(Jul 23 2020 at 21:29)</a>:</h4>
<p>alright, thanks !</p>



<a name="204856337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204856337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204856337">(Jul 23 2020 at 21:36)</a>:</h4>
<p>ah right right your <a href="https://github.com/rust-lang/rust/issues/68966">#68966</a></p>



<a name="204857572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204857572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204857572">(Jul 23 2020 at 21:50)</a>:</h4>
<p>(I wonder about the state of coherence in chalk, and if they have a different strategy than rustc's)</p>



<a name="204857833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204857833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204857833">(Jul 23 2020 at 21:52)</a>:</h4>
<p>hmm, is chalk supposed to do coherence checking?</p>



<a name="204859053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204859053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204859053">(Jul 23 2020 at 22:07)</a>:</h4>
<p>at some point I assume, sunjay did a talk about it 2y ago</p>



<a name="204859166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204859166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204859166">(Jul 23 2020 at 22:08)</a>:</h4>
<p>but I don't really know :)</p>



<a name="204859234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204859234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204859234">(Jul 23 2020 at 22:09)</a>:</h4>
<p>eddy must be hitting this too in their trait system performance work (or will be)</p>



<a name="204859894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204859894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204859894">(Jul 23 2020 at 22:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204795213">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="224872">Ryan Levick</span> <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/stress-test/near/204789699">said</a>:</p>
<blockquote>
<p>cargo build "only" takes 37 minutes on my machine. Not sure why the large difference to my colleague</p>
</blockquote>
<p>What version is used by you and your colleague?</p>
</blockquote>
<p>We're both testing with the current stable. We did seem some differences across intel and AMD based machines with intel being signficantlly faster.</p>



<a name="204860213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204860213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204860213">(Jul 23 2020 at 22:22)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span> do you test on windows or wsl ? are kennykerr's numbers on amd ? does either of you reproduce what I'm seeing wrt rustfmt ? (I'm on an intel machine fwiw)</p>



<a name="204889880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204889880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204889880">(Jul 24 2020 at 08:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> We're both testing on Windows proper. I've also built on macOS. On macOS as I've said cargo build takes around 37 minutes and on my Windows it takes 25 minutes.  Here's a link to Kenny's numbers. He was able to run on both an AMD and Intel machine (<a href="https://github.com/microsoft/winrt-rs/issues/222#issuecomment-663281961">https://github.com/microsoft/winrt-rs/issues/222#issuecomment-663281961</a>). rustfmt takes ~50 seconds or less on every machine I've tested on.</p>



<a name="204890033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890033">(Jul 24 2020 at 08:17)</a>:</h4>
<p>thanks</p>



<a name="204890134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890134">(Jul 24 2020 at 08:18)</a>:</h4>
<p>at least we have some numbers on the slow parts, I'll try to see whether turning on parallelism improves things just so we have an idea</p>



<a name="204890149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890149">(Jul 24 2020 at 08:18)</a>:</h4>
<p>The C++ (MSVC) equivalent takes less than a minute on my machine.</p>



<a name="204890166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890166">(Jul 24 2020 at 08:18)</a>:</h4>
<p>What's the state of parallelism in rustc today?</p>



<a name="204890342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890342">(Jul 24 2020 at 08:21)</a>:</h4>
<p>I'm not up-to-date on the details (mark can comment if I say something wrong) it seems to be working but there are some suboptimal locking and possible bugs, which could require more architectural changes. I don't think it's tested on CI and could have regressed recently. From all this and perf numbers it's believed that this particular implementation will not substantially improve things overall IIRC</p>



<a name="204890413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890413">(Jul 24 2020 at 08:22)</a>:</h4>
<p>(and so is not an area of focus rn, hence the not-tested on CI parts as well -- again that's my own possibly flawed recollection)</p>



<a name="204890565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890565">(Jul 24 2020 at 08:24)</a>:</h4>
<p>It's also extremely likely that the code we're generating is not ideal. One thing the Rust code has to do that the C++ code gets for free is simular inheritance with a bunch of From&lt;T&gt; impls. Perhaps there's a way to improve this</p>



<a name="204890570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890570">(Jul 24 2020 at 08:24)</a>:</h4>
<p>this benchmark is however so single-threaded that it's worth trying at least, to see if the implementation indeed matches the belief</p>



<a name="204890602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890602">(Jul 24 2020 at 08:25)</a>:</h4>
<p>I want to check this as well but yes I hav a feeling about all the From impls contributing to most of the coherence slowness</p>



<a name="204890694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890694">(Jul 24 2020 at 08:26)</a>:</h4>
<p>(which takes 50% of a check run of the full bindings crate)</p>



<a name="204890849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890849">(Jul 24 2020 at 08:28)</a>:</h4>
<p>Can you post the findings from your perf test? Do you have a flamegraph I could look at?</p>



<a name="204890952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204890952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204890952">(Jul 24 2020 at 08:29)</a>:</h4>
<p>I see the trace you posted above. Taking a look...</p>



<a name="204891200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204891200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204891200">(Jul 24 2020 at 08:33)</a>:</h4>
<p>that trace was just a sysout, I'll post the summarize output in just a sec (and will be back at lunch break)</p>



<a name="204891515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204891515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204891515">(Jul 24 2020 at 08:37)</a>:</h4>
<p>(I'm sure you did this already) quick summary of the self profiling <a href="https://gist.github.com/lqd/1fd734846f522de01da87adc59f8c66e">https://gist.github.com/lqd/1fd734846f522de01da87adc59f8c66e</a> + <a href="/user_uploads/4715/2LvTXeKsvlIhNPjnxk0QlkL5/chrome_profiler.zip">zipped crox output for the chrome profiler</a></p>



<a name="204898747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204898747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204898747">(Jul 24 2020 at 10:11)</a>:</h4>
<p>ok this looks like a complex query that is not already parallelized</p>



<a name="204899372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204899372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204899372">(Jul 24 2020 at 10:18)</a>:</h4>
<p>and it seems rarely exercized in our benchmarks besides packed-simd like <span class="user-mention" data-user-id="211727">@Jonas Schievink</span> said, maybe we do need a synthetic benchmark for it</p>



<a name="204927363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/204927363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#204927363">(Jul 24 2020 at 15:06)</a>:</h4>
<p>yeah we don't have much self-profiling data for theses parts of the compiler, so a profiler will have to do just to narrow it down, but the belief is that at least coherence and overlap checks will be slower the more impls there are, so here are stats about that (over the whole crate graph in this example so there will be duplicates for shared dependencies and core) <a href="https://gist.github.com/lqd/d4aa24189260495d53de65f3cc14d2e6">https://gist.github.com/lqd/d4aa24189260495d53de65f3cc14d2e6</a> we can see that there are indeed a lot, 10 traits or so have 10000-60000 impls. Lowering that number somehow, and also I assume splitting into more crates if possible, would make the bindings crate compile faster; (apart from focusing on fixing in rustc these specific parts which scale badly with bigger crates; maybe parallelizing some parts, etc)</p>



<a name="205049236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049236">(Jul 26 2020 at 11:58)</a>:</h4>
<p>for some unfortunate reason <code>perf</code> is now only seeing a small number of rustc function names, so the flamegraph is not super useful, but <a href="https://gist.github.com/lqd/479826a0a6169c7bb0c03f26dd69304d">here it is anyway</a>, the part we're interested in is in the left, that's the things related to the specialization graph, coherence, etc. <a href="/user_uploads/4715/tjGGgn5E6p3nh6JhBOtN-gup/image.png">Highlighted here</a>.</p>
<div class="message_inline_image"><a href="/user_uploads/4715/tjGGgn5E6p3nh6JhBOtN-gup/image.png" title="Highlighted here"><img src="/user_uploads/4715/tjGGgn5E6p3nh6JhBOtN-gup/image.png"></a></div>



<a name="205049249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049249">(Jul 26 2020 at 11:59)</a>:</h4>
<p>For some other unfortunate reason, <code>callgrind</code> doesn't see much more than a big cycle taking 50% of runtime. (All those unfortunate reasons would be solved if I did those things outside a VM for sure, but I don't have access to my work linux box ATM). So I turned to tracing everything in our self-profiling infrastructure, which unfortunately doesn't scale to huge profiles like what I was trying (this is known and rarely a problem IME).</p>



<a name="205049256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049256">(Jul 26 2020 at 11:59)</a>:</h4>
<p>but that did give me the opportunity to try my tracy integration prototype with a big profile, and tracy appears to work absolutely fine (38M profiled areas, most lasting in the microsecs). I did this last test with maybe half of the bindings, so a nightly cargo check would take around 4 mins, and this one with debug assertions + self-profiling + tracy profiling, took around 6mins</p>



<a name="205049297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049297">(Jul 26 2020 at 12:00)</a>:</h4>
<p>Of those we can attribute 3mins to <a href="https://github.com/rust-lang/rust/blob/13f9aa190957b993a268fd4a046fce76ca8814ee/src/librustc_trait_selection/traits/specialize/specialization_graph.rs#L150-L202">this part of the coherence check</a>, checking for overlapping impls like we expected (it's the O(n²) thing that starts to be noticeable on such big crates). It is itself fast (4-5 us in avg, but varies for different impl couples) but gets called 37M times.</p>



<a name="205049315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049315">(Jul 26 2020 at 12:00)</a>:</h4>
<p>Just to show what it looks like, <a href="/user_uploads/4715/gn_3oEa9Klgq7oxmNiPOtY5K/image.png">this is a screenshot</a> of a small part of the tracy profile, with the statistics of the small number of zones I was profiling in <code>librustc_trait_selection</code> here. (The big rectangle at the top has its stats in the lower left, it's taking 45ms, and hierarchically contains (like an inverted flamegraph, the rectangles visually under it) thousands of the small overlapping impls checks I mentioned earlier and whose aggregate stats are shown in the stats window on the right)</p>
<div class="message_inline_image"><a href="/user_uploads/4715/gn_3oEa9Klgq7oxmNiPOtY5K/image.png" title="this is a screenshot"><img src="/user_uploads/4715/gn_3oEa9Klgq7oxmNiPOtY5K/image.png"></a></div>



<a name="205049345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049345">(Jul 26 2020 at 12:01)</a>:</h4>
<p>Might want to try something like <a href="https://github.com/rust-lang/rust/pull/69010">https://github.com/rust-lang/rust/pull/69010</a></p>



<a name="205049412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049412">(Jul 26 2020 at 12:03)</a>:</h4>
<p>interesting, thank you. I can take a look at profiling it with that PR.</p>



<a name="205049486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049486">(Jul 26 2020 at 12:05)</a>:</h4>
<p>I feel the biggest gains would be in lowering the number of checks (which as you've seen is easier said than done) more so than making each check faster, but that probably couldn't hurt this specific case</p>



<a name="205049575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049575">(Jul 26 2020 at 12:07)</a>:</h4>
<p>We could index each impl by the simplified self type</p>



<a name="205049583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049583">(Jul 26 2020 at 12:07)</a>:</h4>
<p>rust-analyzer is doing that</p>



<a name="205049628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049628">(Jul 26 2020 at 12:08)</a>:</h4>
<p>Can someone put up the generated source code? I can't build the project (<code>error: 'rustfmt' is not installed for the toolchain 'stage1'</code>)</p>



<a name="205049647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049647">(Jul 26 2020 at 12:09)</a>:</h4>
<p>early returns, more caching for the compute (to bypass the fresh vars, unification, etc), that's also probably one of the rare cases where parallelisation would be easy and work ok (but just hiding the problem under the rug)</p>



<a name="205049657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049657">(Jul 26 2020 at 12:09)</a>:</h4>
<p>the generated file is 300MB, let met show you how to disable rustfmt</p>



<a name="205049726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049726">(Jul 26 2020 at 12:11)</a>:</h4>
<p>turn this <a href="https://github.com/rylev/stress-rs/blob/master/winrt-rs/crates/macros/src/lib.rs#L110">build macro</a> into <a href="https://gist.github.com/lqd/d6ef8b76dd4d5f4871f4d4d8bcfb53f5">this</a></p>



<a name="205049793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049793">(Jul 26 2020 at 12:12)</a>:</h4>
<p>commenting some/most of <a href="https://github.com/rylev/stress-rs/blob/master/bindings/build.rs">https://github.com/rylev/stress-rs/blob/master/bindings/build.rs</a> will make the generated file smaller</p>



<a name="205049910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205049910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205049910">(Jul 26 2020 at 12:15)</a>:</h4>
<p>I didn't try on stage1 so I'm not sure how much smaller it should be to be comfortable, but on stage2 the first line of the bindings is like &lt;10s, while the first 100-150 or so are what I reported earlier, 4-6mins</p>



<a name="205050397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205050397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205050397">(Jul 26 2020 at 12:31)</a>:</h4>
<p>(browsing around the generated file, I could have missed some, but complex generic impls didn't jump at me, so maybe the early return would be a win here, so I'll try that now)</p>



<a name="205052357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205052357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205052357">(Jul 26 2020 at 13:29)</a>:</h4>
<p>(yeah I think it'd early reject the overwhelming majority of the ones I've seen)</p>



<a name="205052947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205052947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205052947">(Jul 26 2020 at 13:45)</a>:</h4>
<p>I'll play around with the indexing strategy</p>



<a name="205053359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205053359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205053359">(Jul 26 2020 at 13:59)</a>:</h4>
<p>sweet !</p>



<a name="205054490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205054490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205054490">(Jul 26 2020 at 14:34)</a>:</h4>
<p>Hmm, it seems that there's already some filtering based on SimplifiedTypes going on here: <a href="https://github.com/rust-lang/rust/blob/13f9aa190957b993a268fd4a046fce76ca8814ee/src/librustc_trait_selection/traits/specialize/specialization_graph.rs#L90-L93">https://github.com/rust-lang/rust/blob/13f9aa190957b993a268fd4a046fce76ca8814ee/src/librustc_trait_selection/traits/specialize/specialization_graph.rs#L90-L93</a></p>



<a name="205057575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057575">(Jul 26 2020 at 16:10)</a>:</h4>
<p>it's not super clear to me why your early-rejection PR was a slight loss on the other benchmarks, but here, assuming I didn't screw anything up bringing the code over (and I didn't run the tests), it looks to be worth it as most impls do not overlap (on the previous reduced bindings test it was 37M early rejections and  &lt;100K full checks). On the full bindings test it looked like a 45% win, a reduction of around 7mins)</p>



<a name="205057589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057589">(Jul 26 2020 at 16:11)</a>:</h4>
<p>Wow, of the <em>total</em> compile time?</p>



<a name="205057638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057638">(Jul 26 2020 at 16:12)</a>:</h4>
<p>It's weird that the existing logic apparently doesn't suffice.</p>



<a name="205057641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057641">(Jul 26 2020 at 16:12)</a>:</h4>
<p>yes the total time of the bindings + the main</p>



<a name="205057645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057645">(Jul 26 2020 at 16:12)</a>:</h4>
<p>(but not including the dependencies)</p>



<a name="205057663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057663">(Jul 26 2020 at 16:13)</a>:</h4>
<p>there's 2mins or so to generate the file, and that + the rest took 20 mins (on this build w/ assertions, etc) and now it's in the &lt;13 mins</p>



<a name="205057705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057705">(Jul 26 2020 at 16:14)</a>:</h4>
<p>Nice!</p>



<a name="205057777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057777">(Jul 26 2020 at 16:16)</a>:</h4>
<p>I'm not sure what the existing logic does either wrt the simplified types</p>



<a name="205057791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057791">(Jul 26 2020 at 16:17)</a>:</h4>
<p>but it doesn't seem to be preventing doing the full checks when they can't be overlap</p>



<a name="205057842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057842">(Jul 26 2020 at 16:19)</a>:</h4>
<p>again, grain of salt, but it seems you already did a great job on that case :)</p>



<a name="205057980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057980">(Jul 26 2020 at 16:23)</a>:</h4>
<p>If it still spends too much time in coherence I suppose it might be worth to look into the inherent impl overlap check again <a href="https://github.com/rust-lang/rust/pull/69009">https://github.com/rust-lang/rust/pull/69009</a></p>



<a name="205057994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205057994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205057994">(Jul 26 2020 at 16:23)</a>:</h4>
<p>Interestingly that PR caused regressions in the only test I expected it would improve, so that's odd.</p>



<a name="205058832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205058832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205058832">(Jul 26 2020 at 16:48)</a>:</h4>
<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> every crate that implements <code>Clone</code> involves coherence checks of all impls against this odd (negative!) impl from libcore:</p>
<div class="codehilite"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="o">?</span><span class="nb">Sized</span><span class="o">&gt;</span><span class="w"> </span><span class="o">!</span><span class="nb">Clone</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="205060518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060518">(Jul 26 2020 at 17:38)</a>:</h4>
<p>you mean the 1.5%/10ms regression in packed simd in the incremental case ? could be just noise. but we’d assume there’d been gains there if it’s more or less the only one exercizing coherence</p>



<a name="205060577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060577">(Jul 26 2020 at 17:40)</a>:</h4>
<p>Yeah, it does stress coherence quite a bit (though mostly via trait impls, not inherent ones)</p>



<a name="205060578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060578">(Jul 26 2020 at 17:40)</a>:</h4>
<p>it might still be a case of exercizing more than the others but still not that much (and certainly far less than this bindings crate)</p>



<a name="205060581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060581">(Jul 26 2020 at 17:40)</a>:</h4>
<p><code>crate_inherent_impls_overlap_check</code> got slower by ~80%, so I don't think it's noise</p>



<a name="205060651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060651">(Jul 26 2020 at 17:42)</a>:</h4>
<p>ah right I missed that one it’s not in red in the profile for some reason (maybe that the absolute value is small)</p>



<a name="205060730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060730">(Jul 26 2020 at 17:45)</a>:</h4>
<p>yeah the query view only marks execution count differences with color for some reason</p>



<a name="205060732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060732">(Jul 26 2020 at 17:45)</a>:</h4>
<p>we shouldn’t really be computing much during coherence if nothing changed in incremental either way</p>



<a name="205060790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060790">(Jul 26 2020 at 17:47)</a>:</h4>
<p>hmm, maybe coherence queries aren't persisted?</p>



<a name="205060835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060835">(Jul 26 2020 at 17:48)</a>:</h4>
<p>it seems some things are but I’m not sure what :/</p>



<a name="205060848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205060848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205060848">(Jul 26 2020 at 17:49)</a>:</h4>
<p>it won’t hurt to try your change making the checks linear so I’ll do that</p>



<a name="205061238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061238">(Jul 26 2020 at 18:00)</a>:</h4>
<p>ah no it doesn't really stress the inherent overlap checker</p>



<a name="205061253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061253">(Jul 26 2020 at 18:01)</a>:</h4>
<p>so it really is something we don't seem to track, heavy on coherence but differently from packed-simd</p>



<a name="205061377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061377">(Jul 26 2020 at 18:04)</a>:</h4>
<p>svd2rust-generated crates also fall into that category</p>



<a name="205061380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061380">(Jul 26 2020 at 18:04)</a>:</h4>
<p>(this bindings crate is also synthetic-like of course, having lot of impls to match an OOP API, so it's unclear to me how widespread the issue is)</p>



<a name="205061388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061388">(Jul 26 2020 at 18:05)</a>:</h4>
<p>ah interesting</p>



<a name="205061504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061504">(Jul 26 2020 at 18:09)</a>:</h4>
<p>Compile times are a fairly big issue with svd2rust crates. Some SVD files are so complex that the resulting crates simply doesn't compile at all (rustc runs out of memory).</p>



<a name="205061510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061510">(Jul 26 2020 at 18:09)</a>:</h4>
<p>Well, that's compiler memory, but compiletimes are a similar problem</p>



<a name="205061849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205061849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205061849">(Jul 26 2020 at 18:19)</a>:</h4>
<p>there might be some common ways to do things in generated crates, compounded with the amount of generated code, that we don't see elsewhere. It makes sense of course, with bounded perf CI resources.</p>



<a name="205068743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205068743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205068743">(Jul 26 2020 at 21:49)</a>:</h4>
<p>the timing is not super stable (with at least 10s variance in some queries which didn't change), but here's a summary of the early rejection on this case (it probably still has the same behaviour as the PR's results on smaller crates)<br>
before - slowest query: <code>  | specialization_graph_of             | 519.83s   | 45.171          | 519.99s  | 24</code><br>
after - 2nd slowest query: <code>| specialization_graph_of             | 93.81s    | 11.612          | 93.99s   | 24</code><br>
<a href="https://gist.github.com/lqd/acca04b0489e614c8840072d15e0e98e">full self-profile results here</a></p>



<a name="205069127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205069127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205069127">(Jul 26 2020 at 22:02)</a>:</h4>
<p>It seems that the additional fast_reject will weed out Into and From impls very quickly, and there's tens of thousands of them</p>



<a name="205069161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205069161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205069161">(Jul 26 2020 at 22:02)</a>:</h4>
<p>Hmm, but the existing simplify_type categorization should <em>also</em> help there, since the self type is always different</p>



<a name="205071068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205071068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205071068">(Jul 26 2020 at 23:05)</a>:</h4>
<p>Ah, found the issue, it's all the <code>From&lt;Type&gt; for winrt::Object</code> impls. The self type is always the same, but the additional simplify_type logic quickly rules out most impls since <code>Type</code> is always concrete</p>



<a name="205071076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205071076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205071076">(Jul 26 2020 at 23:06)</a>:</h4>
<p>I hope there's a way to make coherence not O(n²) in the worst case though... Seems like that's kind of important for making Rust's compilation model more scalable.</p>



<a name="205082356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205082356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205082356">(Jul 27 2020 at 05:08)</a>:</h4>
<p>agreed completely</p>



<a name="205082710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205082710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205082710">(Jul 27 2020 at 05:18)</a>:</h4>
<p>those and other impls seemed possible to be split to other crates to have the same results as fast rejecting (but maybe detrimental to the ease of use of the API ?)</p>



<a name="205091220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205091220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205091220">(Jul 27 2020 at 08:18)</a>:</h4>
<p>Awesome stuff y'all! Great to see we're already finding places where we might be able to make significant gains.</p>



<a name="205091782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205091782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205091782">(Jul 27 2020 at 08:27)</a>:</h4>
<p>As for moving to other crates, that's totally possible. The likelihood that a user would generate _this_ much code is relatively low, but it would not be uncommon to generate ~20-30% of this in a single crate so it's definitely an issue worth solving.</p>



<a name="205092346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205092346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205092346">(Jul 27 2020 at 08:35)</a>:</h4>
<p>Out of curiousity what is the resolve_crate step doing?</p>



<a name="205093944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205093944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205093944">(Jul 27 2020 at 09:00)</a>:</h4>
<p>I think it's the name resolution parts, for imports, macros, types, etc (or at least one of its phases)</p>



<a name="205158539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/205158539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#205158539">(Jul 27 2020 at 19:30)</a>:</h4>
<p>(I might have to pause looking at this for a short while to have the time to prepare for the polonius workweek next week)</p>



<a name="206439710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/206439710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#206439710">(Aug 10 2020 at 08:48)</a>:</h4>
<p>Hey all - Wondering how I can help make progress here. Any tasks I can take over?</p>



<a name="206440276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/206440276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#206440276">(Aug 10 2020 at 08:58)</a>:</h4>
<p>one task which could be interesting is trying to understand the results of the <a href="https://github.com/rust-lang/rust/pull/69010">early exit PR</a> on smaller crates, it seemed like a pessimization on some cases, which is why it wasn't pursued further. If this can be mitigated, or at least understood, it would help in weighing the PR cost vs its gains; we may need a stress case of just this part of coherence if we wanted to track the performance over time, but I'm not sure if simulacrum or njn would agree</p>



<a name="206440329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/206440329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#206440329">(Aug 10 2020 at 08:59)</a>:</h4>
<p>otherwise, the other big chunk in the profile was resolving, and investigating that seemed worthwhile as well</p>



<a name="208584600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208584600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208584600">(Aug 31 2020 at 16:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> would you have anytime soon to pair with this on me?</p>



<a name="208587520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208587520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208587520">(Aug 31 2020 at 17:07)</a>:</h4>
<p>ah sorry I should have said I was away on vacation for a few days and since my return work has been hectic, limiting my free time quite a lot :/ what did you have in mind ?</p>



<a name="208587640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208587640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208587640">(Aug 31 2020 at 17:08)</a>:</h4>
<p>did you want to look at specific results or investigate the things we mentioned earlier maybe ?</p>



<a name="208693036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208693036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208693036">(Sep 01 2020 at 14:17)</a>:</h4>
<p>I'd like to run through some of the investigation steps together since I have less experience working through this</p>



<a name="208927692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208927692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208927692">(Sep 03 2020 at 07:04)</a>:</h4>
<p>doing this synchronously will be tough in the near future, but I could more easily try to write up a description of that part of the process if that would help ?</p>



<a name="208937552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/stress-test/near/208937552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/stress-test.html#208937552">(Sep 03 2020 at 08:48)</a>:</h4>
<p>That certainly would! It would be much appreciated</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>